/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package SIC115;

import Modelos.Empresa;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Label;

/**
 * FXML Controller class
 *
 * @author Martinez
 */
public class DatosEmpresaController implements Initializable {

    @FXML
    private Label EtiquetaNit;
    @FXML
    private Label EtiquetaNombre;
    @FXML
    private Label EtiquetaRubro;
    private MainApp mainApp;
    private Empresa empresa;

    public DatosEmpresaController() {
    }

    /**
     * Initializes the controller class.
     */
    @Override
    public void initialize(URL url, ResourceBundle rb) {
      Empresa tempEmpresa = new Empresa("1234-09221299-322-1", "Jaggers bar", "Licoreria");
        mostrarDatosEmpresa(empresa);
    }

    private void mostrarDatosEmpresa(Empresa empresa) {
         this.empresa = empresa;
        if (this.empresa != null) {
            EtiquetaNit.setText(empresa.getNit());
            EtiquetaNombre.setText(empresa.getNombre());
            EtiquetaRubro.setText(empresa.getRubro());
        }
    }

    public void setMainApp(MainApp mainApp) {
        this.mainApp = mainApp;
    }

}
